'''
Created on Mar 25, 2012

@author: glenn
'''
import unittest
import os
import json
import zipfile

import sys
sys.path.append('..')

from converter import *
from ppt_png_converter import *

class TestPPTConverter(unittest.TestCase):
    def setUp(self):
        #self._odpFileName = "2slide-presentation.odp"
        self._pptFileName = "4slide-presentation.ppt"
        base = os.path.splitext(self._pptFileName)[0]
        self._zipFileName = base + ".zip"
        self._htmlZipFileName = base + ".html.zip"

    def test_pptConverter(self):
        c = PPTConverter(self._pptFileName, "en")
        a = AudioConverter(c)
        z = ZippedHTML5Converter(self._htmlZipFileName, os.path.join("..", "templates"), a)
        z.convert()

        #y = ZippedJSONConverter(self._zipFileName, a)
        #y.convert()
        
        myzip = zipfile.ZipFile(self._htmlZipFileName, "r")
        for info in myzip.infolist():
            print info.filename, info.date_time, info.file_size, info.compress_size
            # not sure how to test this
        myzip.close()
    
